#ifndef _BSP_H_
#define _BSP_H_

#include "main.h"

extern volatile uint8_t DEBUGFLAG;
extern volatile uint8_t LEDFLAG;
extern volatile uint8_t DevID;

extern volatile uint8_t Usart1_send_buff[32],Usart1_send_count;
extern volatile uint8_t Usart1_recv_buff[64],Usart1_recv_count,Usart1_recv_end_flag;
extern volatile uint16_t Usart1_RecvCnt;

extern volatile uint8_t Usart2_send_buff[32],Usart2_send_count;
extern volatile uint8_t Usart2_recv_buff[64],Usart2_recv_count,Usart2_recv_end_flag;
extern volatile uint16_t Usart2_RecvCnt;

extern volatile uint8_t Usart3_send_buff[32],Usart3_send_count;
extern volatile uint8_t Usart3_recv_buff[64],Usart3_recv_count,Usart3_recv_end_flag;
extern volatile uint16_t Usart3_RecvCnt;

extern volatile uint8_t Uart4_send_buff[32],Uart4_send_count;
extern volatile uint8_t Uart4_recv_buff[64],Uart4_recv_count,Uart4_recv_end_flag;
extern volatile uint16_t Uart4_RecvCnt;

extern volatile uint8_t Uart5_send_buff[32],Uart5_send_count;
extern volatile uint8_t Uart5_recv_buff[64],Uart5_recv_count,Uart5_recv_end_flag;
extern volatile uint16_t Uart5_RecvCnt;

extern volatile uint8_t Usart6_send_buff[32],Usart6_send_count;
extern volatile uint8_t Usart6_recv_buff[64],Usart6_recv_count,Usart6_recv_end_flag;
extern volatile uint16_t Usart6_RecvCnt;

extern volatile uint8_t Uart7_send_buff[32],Uart7_send_count;
extern volatile uint8_t Uart7_recv_buff[64],Uart7_recv_count,Uart7_recv_end_flag;
extern volatile uint16_t Uart7_RecvCnt;

extern volatile uint8_t Uart8_send_buff[32],Uart8_send_count;
extern volatile uint8_t Uart8_recv_buff[64],Uart8_recv_count,Uart8_recv_end_flag;
extern volatile uint16_t Uart8_RecvCnt;

extern volatile uint8_t Uart9_send_buff[32],Uart9_send_count;
extern volatile uint8_t Uart9_recv_buff[64],Uart9_recv_count,Uart9_recv_end_flag;
extern volatile uint16_t Uart9_RecvCnt;

extern volatile uint8_t Usart10_send_buff[32],Usart10_send_count;
extern volatile uint8_t Usart10_recv_buff[64],Usart10_recv_count,Usart10_recv_end_flag;
extern volatile uint16_t Usart10_RecvCnt;
 
extern volatile uint8_t device1SensorRead_end_flag;

extern volatile uint8_t device2SensorRead_end_flag;

extern volatile uint8_t device3SensorRead_end_flag;

extern volatile uint8_t device4SensorRead_end_flag;

extern volatile uint8_t device5SensorRead_end_flag;

extern volatile uint8_t device6SensorRead_end_flag;

extern volatile uint8_t device7SensorRead_end_flag;

extern volatile uint8_t device8SensorRead_end_flag;

extern volatile uint8_t device9SensorRead_end_flag;

extern volatile uint8_t device10SensorRead_end_flag;

extern volatile float jdq1_finish_flag,jdq2_finish_flag,jdq1_time_ct,jdq2_time_ct;
extern volatile float r1,r2,AdcValue,vinAdcValue,vinOffsetValue;
void jdqControl(void);
float powerAdcValueGet(void);

extern char formatted_time[25];
#endif
